<style type="text/css">
.main form {
	margin-bottom: 10px;
}
</style>
<div class="pageheader">
	<h2>
		<i class="fa fa-inbox"></i>库存管理
	</h2>
	<div class="breadcrumb-wrapper">
		<span class="label">你所在的位置：</span>
		<ol class="breadcrumb">
			<li><a href="/index">ERP管理系统</a></li>
			<li>库存管理</li>
			<li class="active">异常库存列表</li>
		</ol>
	</div>
</div>
<div class="contentpanel">
<div class="main">
    <form class="form-inline" method="post" action="/stock/unusual">
		<div class="form-group">
		    <input type="text" value="<?php echo $this->sku;?>" class="form-control" name="sku" placeholder="SKU">
		</div>
		<button type="submit" class="btn btn-primary">搜索</button>
    </form>
	<div class="table-responsive">
		<table class="table table-bordered table-hover">
			<thead>
				<tr>
					<th>SKU</th>
					<th>产品名称</th>
					<th>尺码</th>
					<th>永不下架</th>
					<th>理论库存值</th>
					<th>实际库存值</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
                <?php if ($this->stockList):?>
                <?php foreach ($this->stockList as $v):?>
                <tr>
					<th><?php echo $v['sku'];?></th>
					<td><?php echo $v['title'];?></td>
					<td><?php echo $v['size'];?></td>
					<td><?php echo $v['is_forlong'] ? '是' : '否';?></td>
					<td><?php echo $v['value']; ?></td>
					<td><?php echo $v['t_value']; ?></td>
					<td>
				        <a class="btn btn-default btn-sm" title="修改库存" target="_blank" href="/stock/updatestockvalue?id=<?php echo $v['id'];?>">修改</a> 
					</td>
				</tr>
			    <?php endforeach;?> 
			    <?php endif;?>
			    <?php if(empty($this->sku)){ ?>
			    <tr>
					<td colspan="7">
			            <?php echo $this->paginationControl ( $this->paginator, 'Sliding', 'page/pager.phtml');?>
			        </td>
				</tr>
				<?php } ?>
			</tbody>
		</table>
	</div>
</div>
</div>
